<!DOCTYPE html>
<html lang="en"  xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<body>
<div id="skulist_dlg" class="easyui-dialog" title="sku列表" style="width:700px;height:520px;"
     closed="true"  data-options="resizable:true,modal:false"   >
    <!-----------------列表 ----------------------------->
    <table id="skulist_dg" class="easyui-datagrid"
           data-options="singleSelect:true,method:'get',toolbar:'#skulist_tb'">
        <thead>
        <tr>
            <th data-options="field:'id'" width="10%">库存单元id </th>
            <th data-options="field:'skuName'" width="60%">库存单元名称</th>
            <th data-options="field:'price'" width="30%">价格</th>
            <th data-options="field:'weight',hidden:'true'" >重量</th>
            <th data-options="field:'catalog3Id',hidden:'true'">三级分类</th>
            <th data-options="field:'skuImageList',hidden:'true'"  >图片列表</th>
            <th data-options="field:'skuAttrValueList',hidden:'true'"  >平台属性</th>
            <th data-options="field:'skuSaleAttrValueList',hidden:'true'"  >销售属性</th>
            <th data-options="field:'skuDesc',hidden:'true'"  >商品描述 </th>
            <th data-options="field:'skuDefaultImg',hidden:'true'">默认图片 </th>
        </tr>
        </thead>
    </table>
    <!-----------------列表的工具栏----------------------------->
    <div id="skulist_tb" style="padding:5px;height:auto">
        <div style="margin-bottom:5px">

            <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editSkuInfo()">编辑</a>
            <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true">删除</a>
        </div>
        <input id="spuIdForSkuList" name="spuIdForSkuId" type="hidden"/>
        <input id="catalog3IdForSkuList" name="catalog3IdForSkuId" type="hidden"/>
        <div>
            <a href="#" class="easyui-linkbutton" iconCls="icon-search"  onclick="reloadSkuList()"  >刷新列表</a>
        </div>
    </div>
</div>

</body>
<script language="JavaScript">

    function  initSkuListDlg(spuId,catalog3Id){
        $('#spuIdForSkuList').val(spuId);
        $('#catalog3IdForSkuList').val(catalog3Id);
        $('#skulist_dlg').dialog("open");
        initSkuListDatagrid(spuId);
    }

    function initSkuListDatagrid(spuId){
        $("#skulist_dg").datagrid({url:"skuInfoListBySpu?spuId="+spuId});
    }



    function editSkuInfo(){
        var spuId = $('#spuIdForSkuList').val();
        var catalog3Id=$('#catalog3IdForSkuList').val();
        var skuInfo = $('#skulist_dg').datagrid('getSelected');
        initSkuInfoDlg(spuId,skuInfo,catalog3Id);  //在spuInfoPage.html中
    }












    function removeSpuImg(){

    }


    function checkBeforeSkuDialog(){

        return true;
    }


    /*]]>*/
</script>
</html>